import React from 'react';

import CommonPage from '@/components/page/CommonPage';
import { renderNumber } from '@/utils/common';
const daoName = 'KhjlDjQt';
const importName = 'KhjlDjQt';
const columns: API.Column[] = [
  {
    title: '年份',
    width: 120,
    sorter: true,
    dataIndex: 'NIAN',
    key: 'NIAN',
    dispaly: true,
    filter: true,
    export: false,
  },
  {
    title: '季度',
    width: 120,
    sorter: true,
    dataIndex: 'JIDU',
    key: 'JIDU',
    dispaly: true,
    filter: true,
    export: false,
  },
  {
    title: '员工号码',
    width: 120,
    sorter: true,
    key: 'EMNO',
    dataIndex: 'EMNO',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '员工姓名',
    width: 120,
    sorter: true,
    key: 'EMNM',
    dataIndex: 'EMNM',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '公积金组合贷款投放',
    width: 140,
    sorter: true,
    dataIndex: 'GJJZH',
    key: 'GJJZH',
    render: (data) => renderNumber('.2f', data),
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '每万元销售中收',
    width: 140,
    sorter: true,
    dataIndex: 'XSZS',
    key: 'XSZS',
    render: (data) => renderNumber('.2f', data),
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '每十万元信用卡分期放款',
    width: 140,
    sorter: true,
    dataIndex: 'XYKFQ',
    key: 'XYKFQ',
    render: (data) => renderNumber('.2f', data),
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '每户信用卡新户激活首刷',
    width: 140,
    sorter: true,
    dataIndex: 'XYKSS',
    key: 'XYKSS',
    render: (data) => renderNumber('.2f', data),
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '每百万元代发金额',
    width: 140,
    sorter: true,
    dataIndex: 'DFJE',
    key: 'DFJE',
    render: (data) => renderNumber('.2f', data),
    dispaly: true,
    filter: false,
    export: true,
  },
  {
    title: '每户手机银行新户激活',
    width: 140,
    sorter: true,
    dataIndex: 'SJYHXZ',
    key: 'SJYHXZ',
    render: (data) => renderNumber('.2f', data),
    dispaly: true,
    filter: false,
    export: true,
  },
];
const controls: API.Control[] = [
  {
    name: 'NIAN',
    type: 'year',
    label: '年份',
    grid: 12 / 24,
    dataType: 'number',
    placeholder: '按照YYYYMM格式填入，如201901',
  },
  {
    name: 'JIDU',
    type: 'radio-group',
    label: '季度',
    grid: 12 / 24,
    dataType: 'number',
    options: [
      { value: '1', label: '一季度' },
      { value: '2', label: '二季度' },
      { value: '3', label: '三季度' },
      { value: '4', label: '四季度' },
    ],
  },
  { name: 'EMNO', type: 'text', label: '员工号码', grid: 12 / 24 },
  { name: 'EMNM', type: 'text', label: '员工姓名', grid: 12 / 24 },
  { name: 'GJJZH', type: 'number', dataType: 'number', label: '公积金组合贷款投放', grid: 12 / 24 },
  { name: 'XSZS', type: 'number', dataType: 'number', label: '每万元销售中收', grid: 12 / 24 },
  {
    name: 'XYKFQ',
    type: 'number',
    dataType: 'number',
    label: '每十万元信用卡分期放款',
    grid: 12 / 24,
  },
  {
    name: 'XYKSS',
    type: 'number',
    dataType: 'number',
    label: '每户信用卡新户激活首刷',
    grid: 12 / 24,
  },
  { name: 'DFJE', type: 'number', dataType: 'number', label: '每百万元代发金额', grid: 12 / 24 },
  {
    name: 'SJYHXZ',
    type: 'number',
    dataType: 'number',
    label: '每户手机银行新户激活',
    grid: 12 / 24,
  },
];
const ShIndiLsdjzbdrForm: React.FC = () => {
  return (
    <CommonPage
      daoName={daoName}
      columns={columns}
      controls={controls}
      title="零售定级指标"
      importName={importName}
      importControls={controls}
      importMode="DeleteAfterInsert"
      importParamNames={['NIAN', 'JIDU']}
      importTemplateName="零售定级指标导入"
      keyColName={'ID'}
      initSorter={{ FieldName: 'ID', Direction: 'DESC' }}
    />
  );
};

export default ShIndiLsdjzbdrForm;
